// run: $exec < input
#include <iostream>

int const maxn = 100007;
int a[maxn];
int n, k;

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n >> k;
	int p = 0;
	for (int i = 1; i <= n; i++) {
		std::cin >> a[i];
		if (a[i] < 0) p = i;
	}
	for (int i = 1; i <= p && k; i++, k--)
		a[i] = -a[i];
	k &= 1;
	if (k) {
		if (p == n) a[n] = -a[n];
		else if (!p) a[1] = -a[1];
		else {
			if (a[p] < a[p + 1]) a[p] = -a[p];
			else a[p + 1] = -a[p + 1];
		}
	}
	int sum = 0;
	for (int i = 1; i <= n; i++) sum += a[i];
	std::cout << sum << '\n';
}

